<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="node" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{nodeHome.managed ? 'Edit' : 'Add'} Node</f:facet>



            <s:decorate id="vidField" template="layout/edit.xhtml">
                <ui:define name="label">Vid</ui:define>
                <h:inputText id="vid"
                       required="true"
                          value="#{nodeHome.instance.vid}">
                    <a:support event="onblur" reRender="vidField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="typeField" template="layout/edit.xhtml">
                <ui:define name="label">Type</ui:define>
                <h:inputText id="type"
                       required="true"
                           size="32"
                      maxlength="32"
                          value="#{nodeHome.instance.type}">
                    <a:support event="onblur" reRender="typeField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="languageField" template="layout/edit.xhtml">
                <ui:define name="label">Language</ui:define>
                <h:inputText id="language"
                       required="true"
                           size="12"
                      maxlength="12"
                          value="#{nodeHome.instance.language}">
                    <a:support event="onblur" reRender="languageField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="titleField" template="layout/edit.xhtml">
                <ui:define name="label">Title</ui:define>
                <h:inputTextarea id="title"
                               cols="80"
                               rows="3"
                           required="true"
                              value="#{nodeHome.instance.title}"/>
            </s:decorate>


            <s:decorate id="uidField" template="layout/edit.xhtml">
                <ui:define name="label">Uid</ui:define>
                <h:inputText id="uid"
                       required="true"
                          value="#{nodeHome.instance.uid}">
                    <a:support event="onblur" reRender="uidField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="statusField" template="layout/edit.xhtml">
                <ui:define name="label">Status</ui:define>
                <h:inputText id="status"
                       required="true"
                          value="#{nodeHome.instance.status}">
                    <a:support event="onblur" reRender="statusField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="createdField" template="layout/edit.xhtml">
                <ui:define name="label">Created</ui:define>
                <h:inputText id="created"
                       required="true"
                          value="#{nodeHome.instance.created}">
                    <a:support event="onblur" reRender="createdField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="changedField" template="layout/edit.xhtml">
                <ui:define name="label">Changed</ui:define>
                <h:inputText id="changed"
                       required="true"
                          value="#{nodeHome.instance.changed}">
                    <a:support event="onblur" reRender="changedField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="commentField" template="layout/edit.xhtml">
                <ui:define name="label">Comment</ui:define>
                <h:inputText id="comment"
                       required="true"
                          value="#{nodeHome.instance.comment}">
                    <a:support event="onblur" reRender="commentField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="promoteField" template="layout/edit.xhtml">
                <ui:define name="label">Promote</ui:define>
                <h:inputText id="promote"
                       required="true"
                          value="#{nodeHome.instance.promote}">
                    <a:support event="onblur" reRender="promoteField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="moderateField" template="layout/edit.xhtml">
                <ui:define name="label">Moderate</ui:define>
                <h:inputText id="moderate"
                       required="true"
                          value="#{nodeHome.instance.moderate}">
                    <a:support event="onblur" reRender="moderateField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="stickyField" template="layout/edit.xhtml">
                <ui:define name="label">Sticky</ui:define>
                <h:inputText id="sticky"
                       required="true"
                          value="#{nodeHome.instance.sticky}">
                    <a:support event="onblur" reRender="stickyField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="tnidField" template="layout/edit.xhtml">
                <ui:define name="label">Tnid</ui:define>
                <h:inputText id="tnid"
                       required="true"
                          value="#{nodeHome.instance.tnid}">
                    <a:support event="onblur" reRender="tnidField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="translateField" template="layout/edit.xhtml">
                <ui:define name="label">Translate</ui:define>
                <h:inputText id="translate"
                       required="true"
                          value="#{nodeHome.instance.translate}">
                    <a:support event="onblur" reRender="translateField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{nodeHome.persist}"
                       disabled="#{!nodeHome.wired}"
                       rendered="#{!nodeHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{nodeHome.update}"
                       rendered="#{nodeHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{nodeHome.remove}"
                      immediate="true"
                       rendered="#{nodeHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Node.xhtml"
                rendered="#{nodeHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty nodeFrom ? 'NodeList' : nodeFrom}.xhtml"
                rendered="#{!nodeHome.managed}"/>

        </div>
    </h:form>

</ui:define>

</ui:composition>
